<%-- 
    Document   : editSession
    Created on : Dec 26, 2009, 4:35:06 PM
    Author     : Administrator
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<script type="text/javascript">
    function setRemove(proctorId){
        document.getElementsByName("idToRemove").item(0).value= proctorId;
    }
    function setAdd(proctorId){
        document.getElementsByName("idToAdd").item(0).value = proctorId;
    }
        
</script>
<div style="width: 900px">
    <div style="width: 100%; float: right;">
        <div style="margin-left: 500px;">
            <form method="post">
                <input type="hidden" name="idToRemove"/>
                <table border="1">
                    <tr>
                        <th colspan="3">Assigned proctors</th>
                    </tr>
                    <tr>
                        <th></th>
                        <th></th>
                        <th>Name</th>
                    </tr>
                    <c:forEach var="proctor" items="${session.proctors}" varStatus="counter">
                        <tr>
                            <td>
                                <input name="remove" type="submit" onclick="setRemove(${proctor.autoId})" value="&lt;&lt; Remove" /></td>
                            <td>${counter.count}</td>
                            <td>${proctor.fullname} (${proctor.username})</td>
                        </tr>
                    </c:forEach>
                </table>
            </form>
        </div>
    </div>
    <div style="float: right; margin-right: -500px; width: 500px;">
        <form method="post">
            <input type="hidden" name="idToAdd"/>
            <table border="1">
                <tr>
                    <th colspan="3">Available proctors</th>
                </tr>
                <tr>
                    <th></th>
                    <th>Name</th>
                    <th></th>
                </tr>
                <c:forEach var="proctor" items="${notAssignedProctors}" varStatus="counter">
                    <tr>
                        <td>${counter.count}</td>
                        <td>${proctor.fullname} (${proctor.username})</td>
                        <td>
                            <input name="add" type="submit" onclick="setAdd(${proctor.autoId})" value="Add &gt; &gt;" /></td>
                    </tr>
                </c:forEach>
            </table>
        </form>
    </div>
</div>
